package main;

import gui.main_menu.MainMenuLayout;
import java.util.ArrayList;
import data.Cyclist;
import data.ReadDatabase;
import data.Team;

public class CyclingManager {
	
	public ArrayList<Cyclist> cyclists;
	public ArrayList<Team> teams;
    private static volatile CyclingManager instance;
	
	int width = 1330, heigth = 800;
	
	public CyclingManager() {
		ReadDatabase database = new ReadDatabase();
		teams = database.ReadFromFileTeams("teams.txt");
		cyclists = database.ReadFromFileCyclists("cyclists.txt");
		new MainMenuLayout(width, heigth, this);
	}
	
	public static synchronized CyclingManager getInstance(){
		 if(instance == null){
			 synchronized(CyclingManager.class){
				 if(instance == null){
					 instance = new CyclingManager();
	             }
			 }
		 }
		 return instance;
	 }
	
	public static void main(String args[]) {
		CyclingManager.getInstance();
	}
	
}
